<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:rich="http://richfaces.org/rich"  
      >
      
	<body>
		<ui:composition template="/pages/template/template.xhtml">
			<ui:define name="content">
				<div class="contentWrapper">
					<div id="message-box">
						<h:messages errorClass="error" infoClass="info" layout="list"/>
					</div>
					<div class="contentArea serviceForm">
						<h1>Order Customized Target DNA Enrichment</h1>
						<h:form id="service1_form">
							<h:inputHidden value="#{service1Backing.itemId}"/>
							<table id="orderForm1" class="genostics_form">
								
								<tr id="fileSelect">
									<td>
										<h:selectOneRadio id="fileType" value="#{service1Backing.fileType}">
											<f:selectItem itemLabel="Upload New Samples" itemValue="n"/>
											<f:selectItem itemLabel="Use Existing Samples" itemValue="o"/>
										</h:selectOneRadio>
									</td>
								</tr>
								
								
								<tr>
									<td>
										<table>
											<tr>
												<td valign="top">
													<rich:fileUpload fileUploadListener="#{service1Backing.fileUploadlistener}"
			                							maxFilesQuantity="1" id="sample_upload"
			                							immediateUpload="#{service1Backing.autoUpload}"
			                							acceptedTypes="txt" allowFlash="#{service1Backing.useFlash}"
			                							listHeight="100" listWidth="300">
			                							<a4j:support event="onuploadcomplete" reRender="cart_panel" />
			                							<a4j:support event="onclear" reRender="sample_upload"/>
			            							</rich:fileUpload>
												</td>
												<td valign="top">
													<rich:panel bodyClass="file_info">
			                   							<f:facet name="header">
			                       							<h:outputText value="Smaple File Info" />
			                   							</f:facet>
			                   							Upload target enrichment coordinates or sequences. <b>it must be in text file format </b>
			                   						</rich:panel>
												</td>
											</tr>
										</table>
										
               							
									</td>
								</tr>
								<tr>
									<td>Library Construction Number ($200 each)</td>
								</tr>
								<tr>
									<td>
										<rich:inputNumberSpinner value="#{service1Backing.libraryNum}" minValue="0" maxValue="10"/>
									</td>
								</tr>
								<tr>
									<td>Solexa sequencing lanes for eath library ($1000/lane)</td>
								</tr>
								<tr>
									<td>
										<rich:inputNumberSpinner value="#{service1Backing.seqNum}" minValue="0" maxValue="10"/>
									</td>
								</tr>
								<tr>
									<td>
										<h:commandButton value="Add to Cart" action="#{service1Backing.addToCart}"/>
										<h:commandButton value="Add to Cart and Order Another" action="#{service1Backing.orderNew}"/>
									</td>
								</tr>
							</table>
						</h:form>
					</div>
					<ui:insert name="shoppingCart">
						<ui:include src="../template/shoppingcart.xhtml"/> 
					</ui:insert>
				</div>
				<script type="text/javascript">
					// <![CDATA[ 
						$(document).ready(function(){
							var userFiles = #{sessionScope['currentUser'].userFiles};
							if(userFiles.length == 0) {
								$('#fileSelect').hide();
							}
						});
					// ]]>
				</script>
			</ui:define>
		</ui:composition>
	</body>
</html>